package com.zcl.Thread.t12;

/**
 * @Description:
 * @author: zcl
 * @date: 2022/3/9  13:45
 */
public class MyThread extends Thread{

    @Override
    public void run(){
        super.run();
        for (int i = 0; i < 500000; i++) {
            System.out.println("i = "+ (i+1));
        }
    }
}


class run {
//    public static void main(String[] args) {
//
//        try {
//            MyThread myThread = new MyThread();
//            myThread.start();
//            Thread.sleep(1000);
//            myThread.interrupt();
//            System.out.println("是否停止1? = "+ myThread.interrupted());
//            System.out.println("是否停止2? = "+ myThread.interrupted());
//
//        } catch (InterruptedException e) {
//            System.out.println("main catch!");
//            e.printStackTrace();
//        }
//    }

    public static void main(String[] args) {
        Thread.currentThread().interrupt();
        System.out.println("1 "+ Thread.interrupted());
        System.out.println("2 "+ Thread.interrupted());
        System.out.println("end");
    }
}